import {reqCategoryList} from "@/api"

const state = {
    categoryList:[]
};
const getters = {};
const mutations = {
    RECEIVECATEGORYLIST(state,categoryList){
        state.categoryList = categoryList;
    }
};
const actions = {
    async getCategoryList({ commit},payload){
        const result =  await reqCategoryList();
        if(result.code === 200){
            commit("RECEIVECATEGORYLIST",result.data);
        }
    }
};

export default {
    state,
    getters,
    mutations,
    actions,
}